<template>
	<view class="accountInformationContent">
		<commonNavBar title="抽检信息"    ></commonNavBar>   
		<view class="centre">
			<view class="dt">抽检信息</view> 
			<view class="dd">
				<view class="left">创建时间</view>
				<view class="right">{{ spotData.cjrq }}</view>
			</view>
			<view class="dd">
				<view class="left">更新时间</view>
				<view class="right">{{ spotData.gxrq }}</view>
			</view>
			<view class="dd">
				<view class="left">抽样单位省</view>
				<view class="right">
					{{ spotData.bcjddwshe }}
				</view>
			</view>
			<view class="dd">
				<view class="left">抽样单位市</view>
				<view class="right">
					{{ spotData.bcjddwshi }}
				</view>
			</view> 
			<view class="dd">
				<view class="left">抽样单位县</view>
				<view class="right">
					{{ spotData.bcjddwx }}
				</view>
			</view>
			<view class="dd">
				<view class="left">抽检结论</view>
				<view class="right">
					{{ spotData.jyjg }}
				</view>
			</view>
			<view class="dt">被抽样单位信息</view>
			<view class="dd">
				<view class="left">被抽样单位名称</view>
				<view class="right">{{ spotData.bcydwmc }}</view>
			</view>
			<view class="dd">
				<view class="left">生产许可证号</view>
				<view class="right">{{ spotData.xkzbh }}</view>
			</view> 
			<view class="dd">
				<view class="left">营业执照号</view>
				<view class="right">{{ spotData.yyzzh }}</view>
			</view> 
			<view class="dd">
				<view class="left">许可证ID</view>
				<view class="right">{{ spotData.xkzid }}</view>
			</view> 
			<view class="dt">样品信息</view>
			<view class="dd">
				<view class="left">样品名称</view>
				<view class="right">{{ spotData.ypmc }}</view>
			</view>
			<view class="dd">
				<view class="left">抽样编号</view>
				<view class="right">{{ spotData.cybh }}</view>
			</view> 
			<view class="dd">
				<view class="left">食品大类</view>
				<view class="right">{{ spotData.spdl }}</view>
			</view> 
			<view class="dd">
				<view class="left">食品亚类</view>
				<view class="right">{{ spotData.spyl }}</view>
			</view> 
			<view class="dd">
				<view class="left">食品次亚类</view>
				<view class="right">{{ spotData.spcyl }}</view>
			</view> 
			<view class="dd">
				<view class="left">食品细类</view>
				<view class="right">{{ spotData.spxl }}</view>
			</view> 
			<view class="dd">
				<view class="left">抽样时间</view>
				<view class="right">{{ spotData.cjrq }}</view>
			</view> 
			<view class="dd">
				<view class="left">样品规格</view>
				<view class="right">{{ spotData.ggxh }}</view>
			</view> 
			<view class="dd">
				<view class="left">生产/加工/购进日期</view>
				<view class="right">{{ spotData.scjggjxdrq }}</view>
			</view>  
			<view class="dd">
				<view class="left">原国产</view>
				<view class="right">{{ spotData.ycg }}</view>
			</view> 
			<view class="dd">
				<view class="left">是否进口</view>
				<view class="right">{{ spotData.sfjk }}</view>
			</view> 
			<view class="dt">生产企业信息</view>
			<view class="dd">
				<view class="left">生产企业名称</view>
				<view class="right">{{ spotData.bcscqymc }}</view>
			</view>
			<view class="dd">
				<view class="left">生产企业地址</view>
				<view class="right">{{ spotData.bcscqydz }}</view>
			</view>
			<view class="dd">
				<view class="left">生产企业省份</view>
				<view class="right">{{ spotData.bcscqysf }}</view>
			</view>
			<view class="dd">
				<view class="left">生产企业市</view>
				<view class="right">{{ spotData.city }}</view>
			</view>
			<view class="dd">
				<view class="left">生产企业区</view>
				<view class="right">{{ spotData.dept_qu_name }}</view>
			</view>
		</view>
	 <!-- 	<view class="fixed"  >
			<view class="button" @tap="dimension"   >查看企业信息</view> 
		</view> -->
	</view>
</template>

<script>
	import commonNavBar from '@/components/CommonNavBar.vue';
	
	export default {
		components:{
			commonNavBar
		},
		data() {
			return { 
				spotData: {} 
			}
		},
		onLoad(options) {
			const  that = this; 
			const eventChannel = this.getOpenerEventChannel(); 
			// 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
			eventChannel.on('loadSpotData', function(data) {
			    that.spotData =  data
			})
		},
		methods: {
			goBack() {
				uni.navigateBack();
			}, 
			async dimension(){
				 uni.showLoading({
				 	title:'获取企业信息',
					mask: true
				 })
				const res = await uni.$api.spotCheckGetCompany({
					xkzbh:this.spotData.xkzbh,
					yyzzh:this.spotData.yyzzh
				}); 
				uni.hideLoading();
				if(res.data.code != '0'){
					uni.showToast({
						icon: 'error',
						title:'获取失败'
					})
					return;
				}
				if(res.data.data == null){
					uni.showToast({
						icon: 'error',
						title:'获取不到该企业信息'
					})
					return;
				}
				if(res.data.data.ID == null){
					uni.showToast({
						icon: 'error',
						title:'获取不到该企业信息'
					})
					return;
				}
				//主体标注
				uni.navigateTo({
					url:'/pages/subjectInformation/subjectInformationActive?subjectInformationId='+res.data.data.ID
				})
			}
		}
	}
</script>

<style lang="scss">
	.accountInformationContent {
		background: #F9F9F9;
		// height: calc(100vh - 195rpx);

		.upper {
			position: fixed;
			z-index: 1;
			top: 0;
			left: 0;
			width: 100%;

			.title {
				background: url('../../static/img/inspectBg.png');
				background-size: cover;
				width: 100%;
				height: 115rpx;
				line-height: 115rpx;
				position: relative;
				display: flex;
				justify-content: center;

				.arrow {
					position: absolute;
					left: 33rpx;
					top: 50%;
					transform: translate(0%, -50%);
					width: 100rpx;
					height: 100rpx;

					&::before {
						display: block;
						content: "";
						position: absolute;
						top: 50%;
						left: 0%;
						width: 20rpx;
						height: 20rpx;
						border-left: 1px solid #fff;
						border-top: 1px solid #fff;
						transform: translate(0%, -50%) rotate(-45deg);
					}
				}

				text {
					font-size: 30rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #FFFFFF;
					letter-spacing: 1px;
				}
			}
		}

		.centre {
			// padding: 0 17.5rpx;
			// height: calc(100vh - 280rpx);
			overflow-x: hidden;

			.dt {
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: 24rpx;
				background: #F9F9F9;
				font-weight: bold;
				border-bottom: 2rpx solid #D6D6D6;
				padding: 30rpx 0;
			}

			.dd {
				display: flex;
				justify-content: flex-start;
				font-size: 24rpx;
				border: 2rpx solid #D6D6D6;
				border-top: none;
				background: #fff;

				.left {
					width: 150rpx;
					background: #F9F9F9;
					border-right: 2rpx solid #D6D6D6;
					padding: 20rpx 10rpx 20rpx 20rpx;
				}

				.right {
					width: 600rpx;
					padding: 0 0 0 20rpx;
					display: flex;
					align-items: center;
					 word-break: break-all;
					word-wrap: break-word;
					/*但在有些场景中，还需要加上下面这行代码*/
					white-space: normal;
					
					view {
						background: none;
						border: none;
						font-size: 24rpx;
						position: relative;
						color: #0902FF;

						.triangle {
							width: 0;
							height: 0;
							border-top: 8rpx solid transparent;
							border-bottom: 8rpx solid transparent;
							border-left: 10rpx solid #0902FF;
							position: absolute;
							top: 50%;
							right: -20rpx;
							transform: translate(0%, -50%);
						}
					}

					&.button {
						justify-content: space-around;
					}
				}
			}
		}

		.fixed {
			position: fixed;
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			
			.button {
				margin: 40rpx auto 0;
				width: 269rpx;
				height: 55rpx;
				line-height: 55rpx;
				background: #0552A9;
				border-radius: 10rpx;
				font-size: 20rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				text-align: center;
				color: #fff;
			}
		}
	
		.modifyPopupContent {
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 0 0;

			.title {
				width: 100%;
				height: 80rpx;
				line-height: 80rpx;
				background: url('../../static/img/popupTitle.png') no-repeat center center;
				background-size: cover;
				font-size: 25rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				// text-indent: 45rpx;
				text-align: center;
			}

			.box {
				text-align: center;
				margin: 50rpx auto;

				.dd {
					display: flex;
					justify-content: flex-start;
					font-size: 24rpx;
					border: 2rpx solid #D6D6D6;
					background: #fff;

					.left {
						width: 150rpx;
						background: #F9F9F9;
						border-right: 2rpx solid #D6D6D6;
						padding: 20rpx 10rpx 20rpx 20rpx;
					}

					.right {
						width: 600rpx;
						padding: 0 0 0 20rpx;
						display: flex;
						align-items: center;
					 

						view {
							background: none;
							border: none;
							font-size: 24rpx;
							position: relative;
							color: #0902FF;
						}
					}
					
					&+.dd {
						border-top: none;
					}
				}
			}

			.button {
				margin: 58rpx auto 0;
				padding: 0 95rpx 24rpx 95rpx;
				display: flex;

				button {
					width: 269rpx;
					height: 55rpx;
					line-height: 55rpx;
					background: #0552A9;
					border-radius: 10rpx;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;

					&.determine {
						color: #fff;
					}

					&.cancellation {
						background: none;
						border: 1rpx solid #979797;
						color: #979797;
					}
				}
			}
		}
	}
	.form-input{
		border: 0px;
		border-bottom: 1px solid #F9F9F9;
		color:#000;
		font-size: 24rpx;
	}
</style>